package com.ss.android.article.base.ui;

import android.content.Context;
import android.content.res.TypedArray;

import com.bytedance.common.utility.UIUtils;
import com.handmark.pulltorefresh.library.PullToRefreshBase.Mode;
import com.handmark.pulltorefresh.library.PullToRefreshBase.Orientation;
import com.ss.android.article.base.feature.feed.presenter.RefreshAdManager;

public final class ai extends SSLoadingLayout {
    public String m;
    public RefreshAdManager.o$a n;
    private Context o;

    public ai(Context context, Mode mode, Orientation orientation, TypedArray typedArray) {
        super(context, mode, orientation, typedArray);
        this.o = context;
        this.b = this.findViewById(com.ss.android.article.browser.R.id.pull_ad_icon);
        UIUtils.setVisibility(this.b, 4);
    }

    public final void a(Object arg5, String arg6) {
        if(((arg5 instanceof a)) && ((RefreshAdManager.o$a)arg5).a() && (this.l & 1) != 1 && this.b != null) {
            this.n = ((RefreshAdManager.o$a)arg5);
            this.m = arg6;
            RefreshAdManager.a(this.o).a(this.o, this.n, this.b);
        }
    }

    public final void a(int arg3) {
        super.a(arg3);
        if((this.l & 1) == 1) {
            UIUtils.setVisibility(this.b, 8);
        }
    }

    public final void e() {
        int v2 = 8;
        super.e();
        if((this.l & 1) != 1 && this.b != null) {
            UIUtils.setVisibility(this.c, v2);
            UIUtils.setVisibility(this.e, v2);
            UIUtils.setVisibility(this.f, v2);
            UIUtils.setVisibility(this.g, v2);
            UIUtils.setVisibility(this.h, v2);
        }
    }

    public final int getAdHeight() {
        int v0 = this.b != null ? this.b.getHeight() : -1;
        return v0;
    }

    public final int getContentSize() {
        int v0 = (this.l & 1) == 1 || this.b == null ? super.getContentSize() : super.getContentSize() - this.b.getHeight();
        return v0;
    }

    public final RefreshAdManager.o$a getCurrentAd() {
        return this.n;
    }

    public final boolean k() {
        boolean v0 = this.n != null && this.n.a();
        return v0;
    }
}

